package pers.xiaoliang.concurrency.example.immutable;

/**
* @description: 请求持有对象实体
* @author: xiaoliang.liu
* @date: 2018/7/28 16:14
* @version v1.0
*/
public class RequestHolder {

    private static final ThreadLocal<Long> requestHolder = new ThreadLocal();

    public static void add(Long id) {
        requestHolder.set(id);
    }

    public static Long get() {
        return requestHolder.get();
    }

    public static void remove() {
        requestHolder.remove();
    }
}

